<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/swiper.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <script src="__STATIC__/js/swiper.min.js"></script>
    <title>热点详情</title>
    <style>
        img {
            vertical-align: middle;
            width: auto;
            max-width: 100%;
        }
    </style>
    <script>
        $(function(){
            $(".search").click(
                    function(){
                        var h=$(window).height();
                        $(".board").css({height:h+"px"});
                        $(".footer").css({display:"block"});
                    }
            )
            $(".cancel").click(
                    function(){
                        $(".board").css({height:""});
                        $(".footer").css({display:"none"});
                    }
            )
        })
    </script>
</head>
<body>
<div class="wrap-hotxq">
    <div class="header" style="height: 50px;">
        <p style="font-size: 16px;">{$result.title|default=""}</p>
        <img src="__STATIC__/img_user/back.png" class="back" onclick="back_url()">
        <img src="__STATIC__/img_user/cx-gouwu.png" class="search">
        <img class="share" onclick="share()" src="__STATIC__/img_user/cx-fenxiang.png">
    </div>
    <div class="center">
        <img src="/{$result.picUrl|default=''}" class="pic" onerror=this.src="/static/mobile/img/empty_img.png" >
        <div class="content" style="word-wrap:break-word">
            {$result.content|default=""}
        </div>
    </div>
    <div class="footer">
        <p>活动提及商品(3)</p>
        <div class="swiper-container maning">
            <div class="swiper-wrapper">
                {volist name="result.goods" id='v'}
                <div class="swiper-slide" style="width: 30%;float: left;margin-left: 2.5%;">
                    <a href="javascript:jump_goods_details({$v.id});">
                        <img src="/{$v.thumb_img}" style="width: 100%;" onerror=this.src='/static/mobile/img/empty_img.png' >
                        <p>{$v.title}</p>
                        <!--<span>立即购买</span>-->
                    </a>
                </div>
                {/volist}
            </div>
        </div>
        <img src="__STATIC__/img_user/cancel.png" class="cancel">
    </div>
    <!--遮罩层开始-->
    <div id="shade" class="shade" style="display: none;width: 100%;" onclick = "share()">
        <img src="__STATIC__/img_user/share_bg.png" style="position: absolute;left: 0;top: 0;z-index: 100000;width: 100%;">
    </div>
    <!--遮罩层结束-->
</div>
<script>
    //跳转到商品详情
    function jump_goods_details(id){
        sessionStorage.setItem('goods_url_back',window.location.href);
        window.location.href = "{:url('mobile/user_category/goods_details')}?goods_id="+id;
    }

    // 返回
    function back_url() {
        var url = sessionStorage.getItem('hot_spot');
        if (url) {
            window.location.href=url;
        }else {
            window.location.href="{:url('mobile/user_port/hot_spot')}";
        }

    }

    //分享弹出层
    function share(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            showdiv();
        }else{
            layer.open({content:'请到微信浏览器内访问本页面',skin:'msg',time:4})
        }
    }
    //遮罩层
    function showdiv() {
        var target = document.getElementById('shade');
        if (target.style.display == "none") {
            target.style.display = "block";
            $('body').css('overflow-y','hidden');
            document.documentElement.ontouchmove = function () {
                return false;
            };
        } else {
            document.documentElement.ontouchmove = function () {
                return true;
            };
            target.style.display = "none";
            $('body').css('overflow-y','');
        }
    }
</script>
</body>
</html>
<script type="text/javascript">
    define = null;
    require = null;
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.2.0.js" type="text/javascript"></script>
<script>
    // 微信配置
    //分享
    wx.config({
        debug: false,
        appId: '{$signPackage.appId}',
        timestamp: '{$signPackage.timestamp}',
        nonceStr: '{$signPackage.nonceStr}',
        signature: "{$signPackage.signature}",
        jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',//朋友圈
            'onMenuShareAppMessage',//好友
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
        ]
    });
    var domain = document.domain+'/logo.png';

    //alert(window.location.href);
    //alert(location.href.split('#')[0]);
    wx.ready(function(){
        WeChat('邦成汽配网',window.location.href,"http://bcqpsc.cn/logo.png","我们严选安全可靠的健康产品，结合生活精品.文创产品等.致力于普惠健康");
    });

    function WeChat(share_title,share_link,share_img_url,share_desc,backUrl) {
// 获取"分享到朋友圈"按钮点击状态及自定义分享内容接口
        wx.onMenuShareTimeline({
            title: share_title, // 分享标题
            link: share_link, // 分享链接
            desc: share_desc,
            imgUrl: share_img_url, // 分享图标
            success: function () {
//alert(2);
            },
            cancel: function () {
//alert(1);
            }
        });

// 获取"分享给朋友"按钮点击状态及自定义分享内容接口
        wx.onMenuShareAppMessage({
            title: share_title, // 分享标题
            desc: share_desc, // 分享描述
            link: share_link, // 分享链接
            imgUrl: share_img_url, // 分享图标
            success: function () {
//alert(3);
                window.location.href = "http://app44.app.longcai.net/index.php/mobile/user_port/index";
            },
            cancel: function () {
//alert(4);
            }
        });
// 分享到QQ
        wx.onMenuShareQQ({
            title: share_title, // 分享标题
            desc: share_desc, // 分享描述
            link: share_link, // 分享链接
            imgUrl: share_img_url, // 分享图标
            success: function () {

            },
            cancel: function () {
                return false;
            }
        });
// 分享到QQ空间
        wx.onMenuShareQZone({
            title: share_title, // 分享标题
            desc: share_desc, // 分享描述
            link: share_link, // 分享链接
            imgUrl: share_img_url, // 分享图标
            success: function () {

            },
            cancel: function () {
                return false;
            }
        });
    }



    // 2. 分享接口
    // 2.1 监听“分享给朋友”，按钮点击、自定义分享内容及分享结果接口
    document.querySelector('#onMenuShareAppMessage').onclick = function () {
        wx.onMenuShareAppMessage({
            title: '互联网之子',
            desc: '在长大的过程中，我才慢慢发现，我身边的所有事，别人跟我说的所有事，那些所谓本来如此，注定如此的事，它们其实没有非得如此，事情是可以改变的。更重要的是，有些事既然错了，那就该做出改变。',
            link: window.location.href,
            imgUrl: 'http://app44.app.longcai.net/static/mobile/img_user/qrcode_logo.jpg',
            trigger: function (res) {
// 不要尝试在trigger中使用ajax异步请求修改本次分享的内容，因为客户端分享操作是一个同步操作，这时候使用ajax的回包会还没有返回
                alert('用户点击发送给朋友');
            },
            success: function (res) {
                alert('已分享');
            },
            cancel: function (res) {
                alert('已取消');
            },
            fail: function (res) {
                alert(JSON.stringify(res));
            }
        });
        alert('已注册获取“发送给朋友”状态事件');
//http://blog.csdn.net/baikeliang/article/details/44154547  //623918245资源鸟
    };
</script>